package drds.server.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import drds.server.datasource.IConnectionHolder;

/**
 * 
 */
public class RollbackReleaseHandler extends HandlerAdapter {
	private static final Logger LOGGER = LoggerFactory.getLogger(RollbackReleaseHandler.class);

	@Override
	public void okResponse(IConnectionHolder connectionHolder, byte[] okBytes) {
		LOGGER.debug("autocomit is false,but no commit or rollback ,so  rollbacked backend conn " + connectionHolder);
		connectionHolder.release();
	}

	@Override
	public void errorResponse(IConnectionHolder connectionHolder, byte[] errorBytes) {
		connectionHolder.quit();
	}

}